3.3.38 \(\int (a \cos (e+f x))^m (A+B \cos (e+f x)+C \cos ^2(e+f x)) \, dx\) [238]

Optimal. Leaf size=187 \[ \frac {C (a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}-\frac {(C (1+m)+A (2+m)) (a \cos (e+f x))^{1+m} \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{a f (1+m) (2+m) \sqrt {\sin ^2(e+f x)}}-\frac {B (a \cos (e+f x))^{2+m} \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{a^2 f (2+m) \sqrt {\sin ^2(e+f x)}} \]

[Out]

C*(a*cos(f*x+e))^(1+m)*sin(f*x+e)/a/f/(2+m)-(C*(1+m)+A*(2+m))*(a*cos(f*x+e))^(1+m)*hypergeom([1/2, 1/2+1/2*m],
[3/2+1/2*m],cos(f*x+e)^2)*sin(f*x+e)/a/f/(1+m)/(2+m)/(sin(f*x+e)^2)^(1/2)-B*(a*cos(f*x+e))^(2+m)*hypergeom([1/
2, 1+1/2*m],[2+1/2*m],cos(f*x+e)^2)*sin(f*x+e)/a^2/f/(2+m)/(sin(f*x+e)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 187, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3102, 2827, 2722} \begin {gather*} -\frac {B \sin (e+f x) (a \cos (e+f x))^{m+2} \, _2F_1\left (\frac {1}{2},\frac {m+2}{2};\frac {m+4}{2};\cos ^2(e+f x)\right )}{a^2 f (m+2) \sqrt {\sin ^2(e+f x)}}-\frac {(A (m+2)+C (m+1)) \sin (e+f x) (a \cos (e+f x))^{m+1} \, _2F_1\left (\frac {1}{2},\frac {m+1}{2};\frac {m+3}{2};\cos ^2(e+f x)\right )}{a f (m+1) (m+2) \sqrt {\sin ^2(e+f x)}}+\frac {C \sin (e+f x) (a \cos (e+f x))^{m+1}}{a f (m+2)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a*Cos[e + f*x])^m*(A + B*Cos[e + f*x] + C*Cos[e + f*x]^2),x]

[Out]

(C*(a*Cos[e + f*x])^(1 + m)*Sin[e + f*x])/(a*f*(2 + m)) - ((C*(1 + m) + A*(2 + m))*(a*Cos[e + f*x])^(1 + m)*Hy
pergeometric2F1[1/2, (1 + m)/2, (3 + m)/2, Cos[e + f*x]^2]*Sin[e + f*x])/(a*f*(1 + m)*(2 + m)*Sqrt[Sin[e + f*x
]^2]) - (B*(a*Cos[e + f*x])^(2 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e + f*x]^2]*Sin[e + f*x])
/(a^2*f*(2 + m)*Sqrt[Sin[e + f*x]^2])

Rule 2722

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*((b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1
)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 2827

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 3102

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(
b*(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x],
x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rubi steps

\begin {align*} \int (a \cos (e+f x))^m \left (A+B \cos (e+f x)+C \cos ^2(e+f x)\right ) \, dx &=\frac {C (a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {\int (a \cos (e+f x))^m (a (C (1+m)+A (2+m))+a B (2+m) \cos (e+f x)) \, dx}{a (2+m)}\\ &=\frac {C (a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {B \int (a \cos (e+f x))^{1+m} \, dx}{a}+\left (A+\frac {C (1+m)}{2+m}\right ) \int (a \cos (e+f x))^m \, dx\\ &=\frac {C (a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}-\frac {\left (A+\frac {C (1+m)}{2+m}\right ) (a \cos (e+f x))^{1+m} \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{a f (1+m) \sqrt {\sin ^2(e+f x)}}-\frac {B (a \cos (e+f x))^{2+m} \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{a^2 f (2+m) \sqrt {\sin ^2(e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.31, size = 142, normalized size = 0.76 \begin {gather*} -\frac {\cos (e+f x) (a \cos (e+f x))^m \sin (e+f x) \left ((C (1+m)+A (2+m)) \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right )+(1+m) \left (B \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\cos ^2(e+f x)\right )-C \sqrt {\sin ^2(e+f x)}\right )\right )}{f (1+m) (2+m) \sqrt {\sin ^2(e+f x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a*Cos[e + f*x])^m*(A + B*Cos[e + f*x] + C*Cos[e + f*x]^2),x]

[Out]

-((Cos[e + f*x]*(a*Cos[e + f*x])^m*Sin[e + f*x]*((C*(1 + m) + A*(2 + m))*Hypergeometric2F1[1/2, (1 + m)/2, (3
+ m)/2, Cos[e + f*x]^2] + (1 + m)*(B*Cos[e + f*x]*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e + f*x]^2]
 - C*Sqrt[Sin[e + f*x]^2])))/(f*(1 + m)*(2 + m)*Sqrt[Sin[e + f*x]^2]))

________________________________________________________________________________________

Maple [F]
time = 0.24, size = 0, normalized size = 0.00 \[\int \left (a \cos \left (f x +e \right )\right )^{m} \left (A +B \cos \left (f x +e \right )+C \left (\cos ^{2}\left (f x +e \right )\right )\right )\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cos(f*x+e))^m*(A+B*cos(f*x+e)+C*cos(f*x+e)^2),x)

[Out]

int((a*cos(f*x+e))^m*(A+B*cos(f*x+e)+C*cos(f*x+e)^2),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))^m*(A+B*cos(f*x+e)+C*cos(f*x+e)^2),x, algorithm="maxima")

[Out]

integrate((C*cos(f*x + e)^2 + B*cos(f*x + e) + A)*(a*cos(f*x + e))^m, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))^m*(A+B*cos(f*x+e)+C*cos(f*x+e)^2),x, algorithm="fricas")

[Out]

integral((C*cos(f*x + e)^2 + B*cos(f*x + e) + A)*(a*cos(f*x + e))^m, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \cos {\left (e + f x \right )}\right )^{m} \left (A + B \cos {\left (e + f x \right )} + C \cos ^{2}{\left (e + f x \right )}\right )\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))**m*(A+B*cos(f*x+e)+C*cos(f*x+e)**2),x)

[Out]

Integral((a*cos(e + f*x))**m*(A + B*cos(e + f*x) + C*cos(e + f*x)**2), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))^m*(A+B*cos(f*x+e)+C*cos(f*x+e)^2),x, algorithm="giac")

[Out]

integrate((C*cos(f*x + e)^2 + B*cos(f*x + e) + A)*(a*cos(f*x + e))^m, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (a\,\cos \left (e+f\,x\right )\right )}^m\,\left (C\,{\cos \left (e+f\,x\right )}^2+B\,\cos \left (e+f\,x\right )+A\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cos(e + f*x))^m*(A + B*cos(e + f*x) + C*cos(e + f*x)^2),x)

[Out]

int((a*cos(e + f*x))^m*(A + B*cos(e + f*x) + C*cos(e + f*x)^2), x)

________________________________________________________________________________________